<template>
  <div>
    <a-card :bordered="false" class="table-card">
      <a-row :gutter="32" style="margin: 30px 0 0 30px">
        <a-col :span="24">
          <a-tabs @change="onchange" v-model="keyValue">
            <a-tab-pane key="1" tab="监督对象">
              <a-row :gutter="32">
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="监督对象"
                    style="margin: 20px 0 0 20px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item
                          label="一级子公司"
                          prop="firstSubsidiary"
                        >
                          <a-input
                            v-model="form.firstSubsidiary"
                            placeholder="请输入一级子公司"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="上市公司"
                          prop="listedCompany"
                        >
                          <a-input
                            v-model="form.listedCompany"
                            placeholder="请输入上市公司"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="实际控制全资子公司"
                          prop="controlSubsidiaries"
                        >
                          <a-input
                            v-model="form.controlSubsidiaries"
                            placeholder="请输入实际控制全资子公司"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="职工" prop="workers">
                          <a-input
                            v-model="form.workers"
                            placeholder="请输入职工"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="党员" prop="partyMember">
                          <a-input
                            v-model="form.partyMember"
                            placeholder="请输入党员"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="党组织"
                          prop="partyOrganization"
                        >
                          <a-input
                            v-model="form.partyOrganization"
                            placeholder="请输入党组织"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="党委" prop="partyCommittee">
                          <a-input
                            v-model="form.partyCommittee"
                            placeholder="请输入党委"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="党总支"
                          prop="generalPartyBranch"
                        >
                          <a-input
                            v-model="form.generalPartyBranch"
                            placeholder="请输入党总支"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="党支部" prop="partyBranch">
                          <a-input
                            v-model="form.partyBranch"
                            placeholder="请输入党支部"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
            <a-tab-pane key="2" tab="统计数据">
              <a-row :gutter="32">
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="统计数据"
                    style="margin: 20px 0 0 20px; height: 378px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item
                          label="监督企业"
                          prop="superviseEnterprises"
                        >
                          <a-input
                            v-model="form.superviseEnterprises"
                            placeholder="请输入监督企业"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="监督人数" prop="superviseNum">
                          <a-input
                            v-model="form.superviseNum"
                            placeholder="请输入监督人数"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="重点项目" prop="keyProjects">
                          <a-input
                            v-model="form.keyProjects"
                            placeholder="请输入重点项目"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="执纪问责"
                          prop="accountability"
                        >
                          <a-input
                            v-model="form.accountability"
                            placeholder="请输入执纪问责"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
            <a-tab-pane key="3" tab="廉政建设"
              ><a-row :gutter="32">
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="廉政宣传"
                    style="margin: 20px 0 0 20px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item label="专业书籍" prop="propaganda1">
                          <a-input
                            v-model="form.propaganda1"
                            placeholder="请输入专业书籍"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="身边人案例"
                          prop="propaganda2"
                        >
                          <a-input
                            v-model="form.propaganda2"
                            placeholder="请输入身边人案例"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="警示片资料"
                          prop="propaganda3"
                        >
                          <a-input
                            v-model="form.propaganda3"
                            placeholder="请输入警示片资料"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="清廉手册" prop="propaganda4">
                          <a-input
                            v-model="form.propaganda4"
                            placeholder="请输入清廉手册"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col>
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="清廉建设"
                    style="margin: 20px 0 0 20px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item label="清廉品牌" prop="propaganda1">
                          <a-input
                            v-model="form.propaganda5"
                            placeholder="请输入清廉品牌"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="清廉作品" prop="propaganda2">
                          <a-input
                            v-model="form.propaganda6"
                            placeholder="请输入清廉作品"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="清廉微视频"
                          prop="propaganda3"
                        >
                          <a-input
                            v-model="form.propaganda7"
                            placeholder="请输入清廉微视频"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="清廉产投宣传视频"
                          prop="propaganda4"
                        >
                          <a-input
                            v-model="form.propaganda8"
                            placeholder="请输入清廉产投宣传视频"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col>
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="队伍建设"
                    style="margin: 20px 0 0 20px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item label="纪检委员" prop="propaganda1">
                          <a-input
                            v-model="form.propaganda9"
                            placeholder="请输入纪检委员"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="纪检专干" prop="propaganda2">
                          <a-input
                            v-model="form.propaganda10"
                            placeholder="请输入纪检专干"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item label="司考人员" prop="propaganda3">
                          <a-input
                            v-model="form.propaganda11"
                            placeholder="请输入司考人员"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
            <a-tab-pane key="4" tab="廉政档案"
              ><a-row :gutter="32">
                <a-col :span="12">
                  <a-card
                    :bordered="true"
                    title="廉政档案"
                    style="margin: 20px 0 0 20px"
                  >
                    <a-row
                      :gutter="32"
                      style="width: 80%; margin-left: 10%; padding-top: 20px"
                    >
                      <a-col :span="8">
                        <a-form-model-item
                          label="廉政档案份数"
                          prop="integrityArchivesNum"
                        >
                          <a-input
                            v-model="form.integrityArchivesNum"
                            placeholder="请输入廉政档案份数"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="排查的廉政风险点"
                          prop="integrityArchivesRate"
                        >
                          <a-input
                            v-model="form.integrityArchivesRate"
                            placeholder="请输入排查的廉政风险点"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="岗位风险排查个数"
                          prop="jobRiskNum"
                        >
                          <a-input
                            v-model="form.jobRiskNum"
                            placeholder="请输入岗位风险排查个数"
                          />
                        </a-form-model-item>
                      </a-col>
                      <a-col :span="8">
                        <a-form-model-item
                          label="已存在廉政风险点"
                          prop="jobRiskRate"
                        >
                          <a-input
                            v-model="form.jobRiskRate"
                            placeholder="请输入已存在廉政风险点"
                          />
                        </a-form-model-item>
                      </a-col>
                    </a-row>
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
            <a-tab-pane key="5" tab="日常监督(分数)">
              <a-row :gutter="32">
                <a-col :span="12">
                  <a-card :bordered="false" style="margin: 0px 0 0 20px">
                    <rcjd />
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
            <a-tab-pane key="6" tab="执纪问责">
              <a-row :gutter="32">
                <a-col :span="12">
                  <a-card :bordered="false" style="margin: 0px 0 0 20px">
                    <zjwz />
                  </a-card>
                </a-col> </a-row
            ></a-tab-pane>
          </a-tabs>
        </a-col>
      </a-row>

      <div class="bottom-control1">
        <a-space>
          <a-button
            type="primary"
            @click="submitForm"
            v-if="keyValue != '5' && keyValue != '6'"
          >
            确认保存数据
          </a-button>
        </a-space>
      </div>
    </a-card>
  </div>
</template>
<script>
import {
  listBizCockpitInfo,
  updateBizCockpitInfo,
} from "@/api/biz/bizCockpitInfo";

import Rcjd from "@/views/biz/bizrcjdinfo/index.vue";
import Zjwz from "@/views/biz/bizzjwzinfo/index.vue";
export default {
  name: "BizCockpitInfo",
  components: {
    Rcjd,
    Zjwz,
  },

  data() {
    return {
      // 遮罩层
      loading: true,
      keyValue: "1",
      form: {},
      // 查询参数
      queryParam: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    onchange(key) {
      this.keyValue = key;
    },
    /** 查询驾驶舱信息列表 */
    getList() {
      this.loading = true;
      listBizCockpitInfo(this.queryParam).then((response) => {
        this.form = response.data.list[0];

        this.loading = false;
      });
    },
    submitForm() {
      updateBizCockpitInfo(this.form).then(() => {
        this.$message.success("保存成功");
        this.getList();
      });
    },
  },
};
</script>
<style scoped>
.bottom-control1 {
  width: 100%;
  padding: 30px 16px;
  text-align: center;
  left: 0;
  background: #fff;
}
</style>
